package com.chixing.day05_oop;

public class Account {
        private long accNo;
        private String accName;
        private String accPassword;
        private long accTelNo;
        private float accBalance;
        private int accType; // 0： 储蓄账户， 1： 信用账户

    public Account(){}
    public Account(long accNo, String accName, String accPassword, long accTelNo, float accBalance, int accType) {
        this.accNo = accNo;
        this.accName = accName;
        this.accPassword = accPassword;
        this.accTelNo = accTelNo;
        this.accBalance = accBalance;
        this.accType = accType;
    }

        //存款
        public float depoist(float money){
            System.out.println("父类 Account 的存款方法");
           return 0;
        }
        //取款
        public void withdraw(float money){
            System.out.println("父类 Account 的取款方法");

        }



        public Account updateInfo(){
            this.accTelNo = 187737733L;
            this.accBalance =0;
            this.accPassword="...";
            return this; // this 当前对象
        }





    public long getAccNo() {
        return accNo;
    }

    public void setAccNo(long accNo) {
        this.accNo = accNo;
    }

    public String getAccName() {
        return accName;
    }

    public void setAccName(String accName) {
        this.accName = accName;
    }

    public String getAccPassword() {
        return accPassword;
    }

    public void setAccPassword(String accPassword) {
        this.accPassword = accPassword;
    }

    public long getAccTelNo() {
        return accTelNo;
    }

    public void setAccTelNo(long accTelNo) {
        this.accTelNo = accTelNo;
    }

    public float getAccBalance() {
        return accBalance;
    }

    public void setAccBalance(float accBalance) {
        this.accBalance = accBalance;
    }

    public int getAccType() {
        return accType;
    }

    public void setAccType(int accType) {
        this.accType = accType;
    }


    @Override
    public String toString() {
        return "Account{" +
                "accNo=" + accNo +
                ", accName='" + accName + '\'' +
                ", accPassword='" + accPassword + '\'' +
                ", accTelNo=" + accTelNo +
                ", accBalance=" + accBalance +
                ", accType=" + accType +
                '}';
    }
}
